function seeObject(direction, distance)
	return sonarReading(direction) < distance
end

repeat
	if seeObject(1, 40) then
		forward(A)
		backward(B)
	else
		forward(A)
		forward(B)
	end
until isPressed(ESCAPE)

stop(A)
stop(B)

